<#import "/spring.ftl" as s/>
<@override name="project">
         ${project.name}
</@override>
<@override name="main">
    <ol class="wizard-nav">
        <li class="active"><a href="#"><span class="badge">1</span><small>发布信息</small></a></li>
        <li><a href="#"><span class="badge">2</span><small>触发构建</small></a></li>
        <li><a href="#"><span class="badge badge-info">3</span><small>缺陷报告</small></a></li>
        <li><a href="#"><span class="badge badge-warning">4</span><small>开发范围&特性描述</small></a></li>
        <li><a href="#" data-disabled><span class="badge badge-important">5</span><small>邮件通知&确认发布</small></a></li>
    </ol><br/><br/><br/>
<fieldset >
    <legend>XXX</legend>
    <div id="step1_form_" align="center">
        <form id="step1_form" action="<@s.url '/project/milestone/wizard/wizard_form/'/>${milestone.id}" method="post">
            <table art="form"  autoLabel="true" rightAlign="true" columns="1,9" colon="true">
                <tr>
                    <td></td>
                    <td><input type="hidden" id="_page" name="_page" value="0"></td>
                </tr>

                <tr>
                    <td>
                        <label art="label" for="projectName">项目名称</label>
                    </td>
                    <td>
                        <input type="text"art="textbox" id="projectName" name="projectName" readonly="true" value="${project.name}">
                    </td>
                </tr>

                <tr>
                    <td>
                        <label art="label" for="svnAddr">SVN地址</label>
                    </td>
                    <td>
                        <input type="text"art="textbox" id="svnAddr" name="svnAddr" readonly="true" value="${project.svn_url}" />
                    </td>
                </tr>

                <tr>
                    <td>
                        <label art="label"  for ="version">产品版本</label>
                    </td>
                    <td>
                        <input type="text"art="textbox"id="version" name="version"  value="${milestoneReport.version}" />
                    </td>
                </tr>

                <tr>
                    <td>
                        <label art="label" for ="startTime">开始时间</label>
                    </td>
                    <td>
                        <input type="text" art="datetimer" selectMode=1 id="startTime" name="startTime"
                               <#if milestoneReport.startTime??>value="${milestoneReport.startTime?string("yyyy-MM-dd HH:mm:ss")}"</#if> />
                    </td>
                </tr>

                <tr>
                    <td>
                        <label art="label" for ="dueTime">结束时间</label>
                    </td>
                    <td>
                        <input type="text" art="datetimer" selectMode=1 id="dueTime" name="dueTime"
                               <#if milestoneReport.dueTime??>value="${milestoneReport.dueTime?string("yyyy-MM-dd HH:mm:ss")}"</#if> />
                    </td>
                </tr>

                <tr>
                    <td>
                        <label art="label" for="buildNote" required="true">构建号</label>
                    </td>
                    <td>
                        <input type="text" art="textbox" id="buildNote" title="构建号填写格式请查看右边RDM的缩略图" name="buildNote" readonly="true" value="${milestoneReport.buildNote}"/>
                        <img style="cursor:pointer;width: 20px;height: 20px;" title="构建号说明图示" onclick="show_img()"  src="<@s.url '/resources/common/images/build_info.png'/>"/>
                        <img id ="ajax_processing" src="<@s.url '/resources/layout/img/loading.gif'/>"/ >
                    </td>
                </tr>
                <tr id='tr_form_msg'>
                    <td colspan="2"></td>
                </tr>
                <tr>
                    <td>
                     </td>
                    <td>
                        <button type="submit" id="btn_next" value="next" name="_target1" disabled="disabled"> <span><span>下一步</span></span></button>
                        <button type="submit" name="_cancel" value="_cancel"><span><span>取消</span></span></button>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</fieldset>

</@override>
<@override name="scripts">
<script type="text/javascript">
     var  code ='${project.code}';
     var milestone_id = ${milestone.id};
     var js_param = {
         image_url :'<@s.url '/resources/common/images'/>',
         get_build_note_url:'<@s.url "/project/milestone/wizard/get_build_note"/>'
     }

    $(document).ready(function () {
        get_build_note();

    });
    function  get_build_note(){
        var param={milestone_id:milestone_id};
        cdms.common.ajax_post(js_param.get_build_note_url,param,function (data) {
            data = eval('('+data+')');
            if(data.type){
                $('#buildNote').removeAttr("readonly")
                $('#buildNote').attr('value',data.msg);
                $('#ajax_processing').css("display","none");
                $('#btn_next').removeAttr('disabled');
            }else{
                cdms.common.show_error('tr_form_msg', data.msg);
            }
        });
    }
     function show_img(image){
         $.block({"id":"2","message": "<img style='cursor:pointer' title='"+language.issue.img_back+"'onclick='javascript:$.unblock(2);' src='"+js_param.image_url+"/build_info.png"+"'></img>" });
     }

</script>
<#--<script type="text/javascript" src="<@s.url '/resources/scripts/project/milestone/edit.js'/>"></script>-->
</@override>
<@extends name="/common/projectlayout1.1.ftl" current="milestone" title='${title}' code='${project.code}'></@extends>